package com.chexiehui.jc.mvp.home;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BaseView;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 车辆抵押贷款
 * @Auth SongJun
 * @Date 2019/11/20 10:05
 **/
public interface MortgageApplyCovenant {

    interface View extends BaseView {
        void onSendCodeSuccess(BaseModel<Object> successResult);

        void onSendCodeFailure(BaseModel<Object> failureResult);

        void onDoApplySuccess(BaseModel<Object> successResult);

        void onDoApplyFailure(BaseModel<Object> failureResult);

        String getBorrowingId();
        String getPersonName();

        String getPersonMobile();
        String getPhoneCode();

        String getPersonCity();

        String getCarModelId();

        int getMortgageState();

        String getBuyTime();
    }

    interface Stores {

        @FormUrlEncoded
        @POST(Constants.SEND_CODE)
        Observable<BaseModel<Object>> sendCode(@Field("phone") String phone);
        @FormUrlEncoded
        @POST(Constants.CHECK_CODE)
        Observable<BaseModel<Object>> checkCode(@Field("phone") String phone, @Field("code") String code);

        @FormUrlEncoded
        @POST(Constants.URL_CAR_QUOTA_CALCULATE)
        Observable<BaseModel<Object>> doApply(
                @Field("borrowingId_SelSource") String borrowingId_SelSource,
                @Field("name") String name,
                @Field("phone") String phone,
                @Field("city") String city,
                @Field("carseriesId_SelSource") String carseriesId_SelSource,
                @Field("ismortgage") int ismortgage,
                @Field("BuyTime") String BuyTime
        );

    }

    interface Presenter {
        void sendCode();
        void doApply();

    }

}